package mcp

// // 工具调用处理
// func handleToolsCall(c *lib.GinContext, msg *MCPMessage) *MCPMessage {
// 	params, ok := msg.Params.(map[string]interface{})
// 	if !ok {
// 		return createErrorResponse(msg.ID, -32602, "Invalid params")
// 	}

// 	toolName, ok := params["name"].(string)
// 	if !ok {
// 		return createErrorResponse(msg.ID, -32602, "Missing tool name")
// 	}

// 	arguments, _ := params["arguments"].(map[string]interface{})

// 	switch toolName {
// 	case "list_gitlab_projects":
// 		return handleListGitlabProjects(msg.ID, arguments)
// 	case "get_jenkins_builds":
// 		return handleGetJenkinsBuilds(msg.ID, arguments)
// 	case "ssh_execute_command":
// 		return handleSSHExecuteCommand(c, msg.ID, arguments)
// 	case "get_system_status":
// 		return handleGetSystemStatus(msg.ID, arguments)
// 	case "trigger_pipeline":
// 		return handleTriggerPipeline(c, msg.ID, arguments)
// 	default:
// 		return createErrorResponse(msg.ID, -32601, "Unknown tool: "+toolName)
// 	}
// }

// 创建错误响应
func createErrorResponse(id interface{}, code int, message string) *MCPMessage {
	return &MCPMessage{
		JSONRPC: "2.0",
		ID:      id,
		Error: &MCPError{
			Code:    code,
			Message: message,
		},
	}
}
